package com.boge.tools;

import dev.langchain4j.agent.tool.P;
import dev.langchain4j.agent.tool.Tool;
import org.springframework.stereotype.Component;

import java.time.LocalDate;

@Component
public class WeatherTools {

    @Tool("返回给定城市明天的天气预报")
    String getWeather(@P("需要获取其天气预报的城市") String city) {
        return city+"明天的天气是25°C";
    }

    @Tool("返回明天的日期")
    LocalDate getTomorrow() {

        return LocalDate.now().plusDays(1);
    }

    @Tool("将摄氏度转换为华氏度")
    double celsiusToFahrenheit(@P("将摄氏度转换为华氏度") double celsius) {

        return (celsius * 1.8) + 32;
    }

    String iAmNotATool() {

        return "I am not a method annotated with @Tool";
    }
}
